import service from '../utils/request.js'; // 引入二次封装的 axios

// 家庭老人管理
export const addElderlyInfo = (elderlyInfo) => {
    return service.post('/api/admin/elderlyInfo/add', elderlyInfo);
};

export const deleteElderlyInfoById = (id) => {
    return service.post(`/api/admin/elderlyInfo/delete/${id}`);
};

export const getElderlyInfoById = (id) => {
    return service.get(`/api/admin/elderlyInfo/detail/${id}`);
};

export const listElderlyInfo = (params) => {
    return service.get('/api/admin/elderlyInfo/c_detail', {
        params: {
            id: params.id,
            pageNum: params.pageNum || 1,
            pageSize: params.pageSize || 5,
        }
    });
};

export const updateElderlyInfo = (elderlyInfo) => {
    return service.post('/api/admin/elderlyInfo/update', elderlyInfo);
};

export const deleteElderlyInfoBatch = (its) => {
    return service.post('/api/admin/elderlyInfo/batchDelete', its);
};


// 用户端
//添加
export const ClientAddElderly = (params) => {
    return service.post('/api/client/elderlyInfo/add',params);
};
//删除
export const ClientDeleteElderly = (id) => {
    return service.get(`/api/client/elderlyInfo/delete/${id}`);
};
//修改
export const ClientUpdateElderly = (params) => {
    return service.post('/api/client/elderlyInfo/update/',params);
};
//根据账号主键查询
export const getElderlyInfo = (params) => {
    return service.post('/api/client/elderlyInfo/queryList',params);
};
//根据老人主键查询
export const ClientgetElderlyInfoById = (id) => {
    return service.get(`/api/client/elderlyInfo/detail/${id}`);
};
//批量删除
export const ClientbatchDelete = (ids) => {
    return service.post('/api/admin/elderlyInfo/batchDelete',ids);
};